/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sgbag1.Controlleur;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import sgbag1.Vues.VueAeroport;

/**
 *
 * @author raptorsun
 */
public class GraphicAeroport extends JPanel {

    private VueAeroport vueAeroport;

    public GraphicAeroport(){
        this.setLayout(new FlowLayout());
    }

    public GraphicAeroport(VueAeroport vue) {
        vueAeroport = vue;

        this.setLayout(new FlowLayout());

    }

    public void setAeroport(VueAeroport vue){
        vueAeroport = vue;
        System.out.println(vueAeroport);
        //vueAeroport.setTailleFenetre(this.getWidth(), this.getHeight());
    }


    @Override
    public void paintComponent(Graphics g) {
        this.setBackground(Color.yellow);
        
        super.paintComponent(g);
        //System.out.println("drawing aeroport....\n");
        if(vueAeroport != null){
            //System.out.println("Size of image : "+this.getWidth()+" X "+this.getHeight());
            vueAeroport.setTailleFenetre(this.getWidth(), this.getHeight());
            vueAeroport.Dessiner(g);
        }
        
    }



}
